package xyz.robinbingo.effectivejava.chapter03.item11;

import cn.hutool.core.lang.Console;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Robin
 * @date 2019/03/21 15:33
 **/
@RunWith(SpringRunner.class)
@SpringBootTest
public class Item11 {
    @Test
    public void test00() {
        Map<PhoneNumber, String> m = new HashMap<>();
        m.put(new PhoneNumber(707, 867, 5309), "Jenny");
        String s = m.get(new PhoneNumber(707, 867, 5309));
        Console.log(s);
    }

    @Test
    public void test01() {
        Map<PhoneNumber, String> m = new HashMap<>();
        m.put(new PhoneNumber(707, 867, 5309), "a");
        m.put(new PhoneNumber(3, 867, 5309), "b");
        m.put(new PhoneNumber(5, 867, 5309), "c");
        m.put(new PhoneNumber(6, 867, 5309), "d");
        String s = m.get(new PhoneNumber(707, 867, 5309));
        Console.log(s);
    }
}
